from api.Litemail_login import Litemail

class Test_Login:
    Token = None
    # 前置操作
    def setup_method(self):
        # 实例化登录
        self.lite = Litemail()

    # 后置操作
    def teardown_method(self):
        pass

    # 登陆成功
    def test_success(self):
        json01 ={"username":"user123","password":"user123"}
        rep01 = self.lite.get_login(json01)
        assert "成功" in rep01.text

    # 登录失败（账号为空）
    def test_login_whitout_username(self):
        json02 = {"username":"","password":"user123"}
        rep02 = self.lite.get_login(json02)
        assert "账号不存在" in rep02.text
    #登录失败（密码为空）
    def test_login_whitout_password(self):
        json03 = {"username":"user123","password":""}
        rep03 = self.lite.get_login(json03)
        assert "账号密码不对" in rep03.text
